package com.flyduck.system.vo.post.trans;


import cn.hutool.core.bean.BeanUtil;
import com.flyduck.system.entity.SysPostEntity;
import com.flyduck.system.vo.post.SysPostRespVO;
import com.google.common.base.Function;


/**
 * @program: flyduck-platform
 * @description:
 * @author: flyduck
 * @create: 2021-02-01 12:42
 **/
public class SysPostEntityToSysPostRespVO implements Function<SysPostEntity, SysPostRespVO> {

    @Override
    public SysPostRespVO apply(SysPostEntity entity) {
        SysPostRespVO sysPostRespVO = new SysPostRespVO();
        BeanUtil.copyProperties(entity,sysPostRespVO);
        sysPostRespVO.setId(entity.getId()+"");
        sysPostRespVO.setSort(String.valueOf(entity.getSort()));
        return sysPostRespVO;
    }
}
